/**************************************************************************************** Import */
import _ from 'lodash';
import React, {Component} from 'react';
import { TextInput, View, Dimensions, TouchableHighlight, StyleSheet, ImageBackground } from 'react-native';
import { Icon,  List, Button, InputItem, Tabs, TextareaItem, DatePicker, Accordion, Picker, Switch } from 'antd-mobile-rn';
import { CAround, CBetween, CCenter, CColumn, CFloat, CHand, CItemX, CItemY, CLine, CLoad, CRow, CWrap, CBone, CIcon, CImage, CSvg, CText, CFull, CScroll, CFooter, CHeader, CPage, CButton, CLabel, PTabbar, PHeader } from '../../library/comp';
import { Dialog, Http, PageBase } from '../../library/func';
import Design from '../../design';
import Config from '../../config';

/**************************************************************************************** Pageload */

/**************************************************************************************** Cacheload */

/**************************************************************************************** Preload */

/**************************************************************************************** Get */

/**************************************************************************************** Post */

/**************************************************************************************** Page */
export default class User extends PageBase {
    constructor(props) {
        super(props);
        this.state = {
            headImage:'https://wx4.sinaimg.cn/mw690/6909cd6dly1fp3jzs0r7rj20m80m8ww6.jpg',
            phone:'123456789',
            id:1
        };
    }


    /************************************************************************************ Life */
    componentDidMount() {
        
        // HttpTemp.get({
        //     url:'/CPage/user/detail.php',
        //     success:(res)=>{
        //         this.setState({
        //             headImage:res.data.object.set_head,
        //             phone:res.data.set_mobile,
        //             id:res.data.id
        //         })
        //         console.log('res++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++',res)
        //         console.log('this.state++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++',this.state)
        //     }
        // })
    }

    /************************************************************************************ Func */
    render(){
        return(
            <CPage>
                <CScroll bg='#efeff4' mb='70'>
                
                    {/* 个人信息 star */}
                    <CRow style={{backgroundColor:'#505c5f'}}>
                        <ImageBackground source={require('../../design/asset/image/usertop.png')} style={{width:'100%',height:'100%'}} resizeMode='cover'>
                            {/* 设置按钮 star */}
                            {/* <CRow x='right' pa='28 30' pt='40'>
                                <CHand  onPress={(e)=> {
                                    // Dialog.text("您所在的小区暂未开启此功能");
                                    this.nav.navigate('User_System');
                                }}>
                                    <CHand w='56' h='56' ra='28' oh >
                                        <CIcon width="25" height="25" color="#fff" icon={ Design.icon["person-center-set"] }></CIcon>
                                    </CHand>
                                </CHand>
                            </CRow> */}
                            {/* 设置按钮 end */}
                            {/* 头像信息 star */}
                            <CRow px='30'>
                                <CBetween>
                                    <CItemX x='left' y='center' f='1' my='100'>
                                        {/* my为临时样式 */}
                                        <CHand w='116' h='116' ra='58' oh mr='26'>
                                            <CImage source={{uri:this.state.headImage+'?l='+Math.random()}} w='116' h='116' ra='58' resizeMode='cover' style={{backgroundColor:'#efeff4'}}></CImage>
                                        </CHand>
                                        <CHand w='200' h='116' oh mr='26' y="center">
                                            <CText color='#fff' size='30'>{this.state.phone.substring(0,3)+'****'+this.state.phone.substring(7,11)}</CText>
                                        </CHand>
                                    </CItemX>
                                    {/* <CHand top="40"   onPress={(e)=> {
                                            this.nav.navigate('UserSetting');
                                        }}>
                                        <CItemX x='right' f='1'>
                                                <CText color='#fff' size='22'>3项未完善</CText>
                                        </CItemX>
                                    </CHand> */}

                                </CBetween>
                            </CRow>
                            {/* 头像信息 end */}
                            {/* 展示栏 star */}
                            {/* <CRow pa='20 30'>
                                <CBetween pb='4'>
                                    <CItemY x='center' y='center' w='116' onPress={(e)=> {this.nav.navigate(''); }}>
                                        <CItemY x='center' y='center'>
                                            <CText pt='4' color='#fff' size='36' mb='14'>0</CText>
                                            <CText color='#fff' size='24'>佣金</CText>
                                        </CItemY>
                                    </CItemY>
                                    <CItemY>
                                        <CText h='40' w='2' bg='#fff'></CText>
                                        <CText color='#fff' size='24'> </CText>
                                    </CItemY>
                                    <CItemY x='center' y='center' w='116' onPress={(e)=> {this.nav.navigate('User_Virtual_Cash'); }}>
                                        <CItemY x='center' y='center'>
                                            <CText pt='4' color='#fff' size='36' mb='14'>0.00</CText>
                                            <CText color='#fff' size='24'>余额</CText>
                                        </CItemY>
                                    </CItemY>
                                    <CItemY>
                                        <CText h='40' w='2' bg='#fff'></CText>
                                        <CText color='#fff' size='24'> </CText>
                                    </CItemY>
                                    <CItemY x='center' y='center' w='116' onPress={(e)=> {this.nav.navigate(''); }}>
                                        <CItemY x='center' y='center'>
                                            <CText pt='4' color='#fff' size='36' mb='14'>0</CText>
                                            <CText color='#fff' size='24'>红包卡卷</CText>
                                        </CItemY>
                                    </CItemY>
                                </CBetween>
                            </CRow> */}
                            {/* 展示栏 end */}
                        </ImageBackground>
                    </CRow>
                    {/* 个人信息 end */}

                    {/* 菜单条目 star */}
                    {/* <CRow my='5'>
                        <CColumn f='1'>

                            <CHand style={{width:Config.map.screen.width}} bb='solid 1 #f0f0f0' onPress={(e)=> {
                                this.nav.navigate('');
                            }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='120' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["server-moneylist"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">我的订单</CText> 
                                    </CHand>
                                </CRow>
                            </CHand>

                            <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> {
                                this.nav.navigate('');
                            }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["location"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">收货地址</CText> 
                                    </CHand>
                                </CRow>
                            </CHand>

                            <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> {
                                this.nav.navigate('');
                            }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["shop-gouwche"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">我的购物车</CText> 
                                    </CHand>
                                </CRow>
                            </CHand>

                        </CColumn>
                    </CRow> */}
                    <CRow mt='20' mb='0'>
                        <CColumn f='1'>

                            {/* <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> {this.nav.navigate('User_Listing_Activity'); }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["myactivty"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">我的活动</CText> 
                                    </CHand>
                                </CRow>
                            </CHand> */}

                            <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> { this.nav.navigate('User_Listing_Msg'); }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["server-msg"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">我的消息</CText> 
                                    </CHand>
                                </CRow>
                            </CHand>

                            <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> { this.nav.navigate('Help'); }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["index-help"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">帮助反馈</CText> 
                                    </CHand>
                                </CRow>
                            </CHand>

                        </CColumn>
                    </CRow>

                    {/* <CRow mt='20' mb='0'>
                        <CColumn f='1'> */}

                            

                            {/* <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> {
                                this.nav.navigate('');
                            }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["person-center-share"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">
                                            应用分享
                                        </CText> 
                                    </CHand>
                                </CRow>
                            </CHand> */}

                        {/* </CColumn>
                    </CRow> */}
                    <CRow mt='20' mb='0'>
                        <CColumn f='1'>

                            {/* <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> {this.nav.navigate('User_Listing_Activity'); }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["myactivty"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">我的活动</CText> 
                                    </CHand>
                                </CRow>
                            </CHand> */}

                            <CHand style={{width:Config.map.screen.width}} bb='solid 2 #f0f0f0' onPress={(e)=> { this.nav.navigate(''); }}>
                                <CRow h='130' x='left' y='center' px='30' bg='#fff' f='1' style={{width:Config.map.screen.width}}>
                                    <CHand w='80' h='60' oh x='center' y='center'>
                                        <CIcon width="20" height="20" color="#888" icon={ Design.icon["server-xiu"] }></CIcon>
                                    </CHand>
                                    <CHand ml='20'>
                                        <CText color='#515151' size="30">注销登录</CText> 
                                    </CHand>
                                </CRow>
                            </CHand>

                        </CColumn>
                    </CRow>
                    {/* 菜单条目 end */}
                </CScroll>

                {/* 底部 */}
				<PTabbar current='User' nav={this.nav}></PTabbar>
            </CPage>
        )
    }
}
